package com.example.dzbsh.controller;


import com.example.dzbsh.service.DictRenyuanleibieService;
import com.example.dzbsh.util.JsonResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("dict_renyuanleibie")
public class DictRenyuanleibieController {
    @Autowired
    DictRenyuanleibieService ddService;

    private Logger logger = LoggerFactory.getLogger(getClass());

    @RequestMapping("find_valid")
    public JsonResult<?> findValid(){
        try {
            return JsonResult.getSuccessResult(ddService.findValid());
        } catch (Exception e) {
            e.printStackTrace();
            logger.error("dict_renyuanleibie -> find_valid: " + e.getMessage());
            return JsonResult.getErrorResult("查找有效数据失败！");
        }
    }
}
